Skip to content

Conversation

@lukasbischof
Copy link
Member

@lukasbischof lukasbischof commented Feb 4, 2026

I wanted to have a unified CLI that manages dedicated and shared databases and provides an interface to get backups so I can use them locally

Screenshot.on.2026-02-04.at.17.11.mp4

I followed the same scheme of having -. Sadly, this leads to some weird names when we had the project name repeated in the database name

kind = data["kind"] || ""

unless kind == "Postgres" || @nctl.dry_run
Output.error("Backups can only be downloaded for PostgreSQL databases. (shared dbs are not supported)")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not supported yet afaik

Copy link
Member

@coorasse coorasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! One of the most useful features!!!
In all the other commands we use --app to define the app, shouldn't we follow the same pattern here? Otherwise it might be confusing.
deploio pg backups download --app APP_NAME.

this would download the backup of the DATABASE_URL of the app by default, otherise we could specify the --db?

I want to hear your opinion

def get_all_pg_databases
output_dedicated_dbs = capture("get", "postgres", "-A", "-o", "json")
output_shared_dbs = capture("get", "postgresdatabase", "-A", "-o", "json")
if (output_dedicated_dbs.nil? || output_dedicated_dbs.empty?) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (output_dedicated_dbs.nil? || output_dedicated_dbs.empty?) &&
if output_dedicated_dbs.empty? &&

if it's nil, .empty? returns true already, no?

@lukasbischof
Copy link
Member Author

Thanks for the inputs @coorasse. I like the idea that you don't have to specify the database but rather an app.
In the end, that's how Heroku deals with it too. Let's see if I find the time to implement this

Coming to --db: The interface currently is inspired by Heroku. There, it is directly after the command (e.g. heroku pg:backups:capture [DATABASE]). I like that, actually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants